<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <style type="text/css">
        #main {
            width: 760px;
            margin: 0 auto;
            border: 1px solid rgba(86, 137, 145, 0.51);
            background-color: rgba(99, 179, 227, 0.45);
        }
    </style>
    <script src="main/jquery-1.12.4.min.js"></script>
    <script src="main/d3.v3.min.js"></script>
    <script src="main/angular.min.js"></script>
</head>
<body>
<div id="main">
    <div class="stockTitle" ng-app="stockTitle" ng-controller="stockTitleController">
        <div class="topName">
            <span>
				<input type="text" id="code" width="37px">
				<button ng-onclick="stockTitleHttpController()">搜索</button>
            </span>
			<br>
            <span class="stockName">
                <a href="{{url}}">
                    <strong title="" class="stockName">{{name+code+exchange ||'请搜索个票代码' }}</strong>
                </a>
            </span>
            <span class="stockOp"><a href="" class="stockPerformance">持仓 </a>
                <span class="stockFollowRelation">
                    <span id="addStock" class="addFriendBtn op"><b>＋</b>加关注</span>
                </span>
            </span>
            <div class="fix"></div>
        </div>
        <div class="fix"></div>
    </div>
    <div class="stockQuote">
        <div id="currentQuote">
            <div class="currentInfo"><strong data-current="109.97" class="stockUp">$109.97</strong>
                <span class="stockUp"><span>+0.410</span><span class="quote-percentage">&nbsp;&nbsp;(+0.37%)</span></span>
            </div>
            <div class="stockInfo"><span id="timeInfo">05-27 13:46:16 (美东时间)&nbsp;&nbsp;</span></div>
            <div class="afterHours"><span class="afterHoursTip">盘前交易&nbsp;&nbsp;</span>
                <span id="afterHoursData" class="stockUp">$109.65&nbsp;&nbsp;+0.09&nbsp;&nbsp;(+0.08%)</span>
            </div>
        </div>
        <table class="topTable">
            <tr>
                <td>今开：<span>109.65</span></td>
                <td>最高：<span id="quote-high">110.14</span></td>
                <td>52周最高：<span>115.75</span></td>
                <td title="当日成交量，单位：股">成交量：<span id="quote-volume">1010.57万股</span></td>
            </tr>
            <tr class="seperateTop">
                <td>昨收：<span>109.56</span></td>
                <td>最低：<span id="quote-low">109.61</span></td>
                <td>52周最低：<span>84.74</span></td>
                <td title="单位：%">振幅：<span>0.48%</span></td>
            </tr>
            <tr class="seperateBottom">
                <td>换手率：<span>3.05%</span></td>
                <td>总市值：<span>362.92亿</span></td>
                <td title="最近报告期每最近四个季度每股收益，单位:美元">每股收益：<span>23.58</span></td>
                <td>市盈率LYR/TTM：<span>-/4.69</span></td>
            </tr>
            <tr>
                <td>50日均线：<span>107.79</span></td>
                <td>总股本：<span>3.31亿</span></td>
                <td title="最近四个季度每股净资产，单位:美元">每股净资产：<span>-</span></td>
                <td>市净率MRQ：<span>-</span></td>
            </tr>
            <tr>
                <td>200日均线：<span>107.50</span></td>
                <td>机构持股：<span>35.00%</span></td>
                <td title="最近报告期发放股息/股息收益率，单位：美元/%">股息/收益：<span>1.17/1.07</span></td>
                <td title="卖空股数/日平均成交量">空头补回天数：<span>-</span></td>
            </tr>
        </table>
    </div>
</div>
<script>
    var stockTitle = angular.module('stockTitle',[]);
    stockTitle.controller('stockTitleController', function ($scope) {
        $scope.stockTitleHttpController = function ($scope, $http) {
            var code = $scope.code;
            console.log(231232);
            alert(code);
            var url = "http://localhost:8080/s/stock/QQQ";
            $http.get(url).success(function (response) {
                var data=response.data;
                if(data){
                    $scope.url = data.url;
                    $scope.code=data.code;
                    $scope.name=data.name;
                    $scope.exchange=data.exchange;
                }else {
                    alert("您访问的页面不存在")
                }
            });

        }

    })


</script>

</body>
</html>